Other Constants
MGLClusterIdentifierInvalid
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLErrorDomain
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLExpressionInterpolationModeCubicBezier
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLExpressionInterpolationModeExponential
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLExpressionInterpolationModeLinear
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLFontColorAttribute
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
The font color expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontColorAttributeSwift
static let fontColorAttribute: MGLAttributedExpressionKey - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLFontNamesAttribute
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
The font color expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontColorAttributeSwift
static let fontColorAttribute: MGLAttributedExpressionKey - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLFontScaleAttribute
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
The font color expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontColorAttributeSwift
static let fontColorAttribute: MGLAttributedExpressionKey - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLMapViewDecelerationRateFast
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLMapViewDecelerationRateImmediate
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
The font color expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontColorAttributeSwift
static let fontColorAttribute: MGLAttributedExpressionKey - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLMapViewDecelerationRateNormal
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
The font color expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontColorAttributeSwift
static let fontColorAttribute: MGLAttributedExpressionKey - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLMapViewPreferredFramesPerSecondDefault
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
The font color expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontColorAttributeSwift
static let fontColorAttribute: MGLAttributedExpressionKey - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLMapViewPreferredFramesPerSecondLowPower
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
The font color expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontColorAttributeSwift
static let fontColorAttribute: MGLAttributedExpressionKey - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLMapViewPreferredFramesPerSecondMaximum
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLOfflinePackErrorNotification
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLOfflinePackMaximumMapboxTilesReachedNotification
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
MGLShapeSourceOptionWrapsCoordinatesAn
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLOfflinePackProgressChangedNotification
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLOfflinePackUserInfoKeyError
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLOfflinePackUserInfoKeyMaximumCount
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLOfflinePackUserInfoKeyProgress
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLOfflinePackUserInfoKeyState
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLShapeSourceOptionBuffer
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLShapeSourceOptionClipsCoordinates
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLShapeSourceOptionClusterProperties
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLShapeSourceOptionClusterRadius
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLShapeSourceOptionClustered
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLShapeSourceOptionLineDistanceMetrics
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLShapeSourceOptionMaximumZoomLevel
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLShapeSourceOptionMaximumZoomLevelForClustering
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLShapeSourceOptionMinimumZoomLevel
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLShapeSourceOptionSimplificationTolerance
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLShapeSourceOptionWrapsCoordinates
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLTileSourceOptionAttributionHTMLString
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLTileSourceOptionAttributionInfos
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLTileSourceOptionCoordinateBounds
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLTileSourceOptionDEMEncoding
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLTileSourceOptionMaximumZoomLevel
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLTileSourceOptionMinimumZoomLevel
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLTileSourceOptionTileCoordinateSystem
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MGLTileSourceOptionTileSize
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MapboxVersionNumber
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyMaximumCount
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[] 
MapboxVersionString
The following constants are available globally.
- 
                            
MGLFontNamesAttribute
The font name string array expression used to format the text.
Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontNamesAttributeSwift
static let fontNamesAttribute: MGLAttributedExpressionKey - 
                            
MGLFontScaleAttribute
The font scale number expression relative to
MGLSymbolStyleLayer.textFontSizeused to format the text.Declaration
Objective-C
extern const MGLAttributedExpressionKey _Nonnull MGLFontScaleAttributeSwift
static let fontScaleAttribute: MGLAttributedExpressionKey - 
                            
MGLFontColorAttribute
 - 
                            
MGLClusterIdentifierInvalid
An
NSUIntegerconstant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.Declaration
Objective-C
extern const NSUInteger MGLClusterIdentifierInvalidSwift
let MGLClusterIdentifierInvalid: UInt - 
                            
MGLShapeSourceOptionWrapsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value isNO.Setting this option to
YESaffects rendering performance.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinatesSwift
static let wrapsCoordinates: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClipsCoordinates
An
NSNumberobject containing a Boolean value; specifies whether the shape of anMGLComputedShapeSourceshould be clipped at the edge of each tile. The default value isNO.Setting this option to
YESaffects rendering performance. Use this option to clipMGLPolylines andMGLPolygons at tile boundaries without artifacts.This option is used with the
MGLComputedShapeSourceclass; it is ignored when creating anMGLShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinatesSwift
static let clipsCoordinates: MGLShapeSourceOption - 
                            
MGLOfflinePackProgressChangedNotification
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackUserInfoKeyStatekey and details about the pack’s current progress in theMGLOfflinePackUserInfoKeyProgresskey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Related examples
See the Download an offline map example to learn how to calculate the progress of an offline download.
Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name - 
                            
MGLOfflinePackErrorNotification
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackUserInfoKeyErrorkey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name - 
                            
MGLOfflinePackMaximumMapboxTilesReachedNotification
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackUserInfoKeyMaximumCountkey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name - 
                            
MGLOfflinePackUserInfoKeyState
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyProgress
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey - 
                            
MGLOfflinePackUserInfoKeyError
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey - 
                            
                            
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey - 
                            
MGLTileSourceOptionDEMEncoding
An
NSNumberobject containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described inMGLDEMEncoding.The default value for this option is
MGLDEMEncodingMapbox.This option cannot be represented in a TileJSON or style JSON file. It is used with the
MGLRasterDEMSourceclass and is ignored when creating anMGLRasterTileSourceorMGLVectorTileSourceobject.Declaration
Objective-C
extern const MGLTileSourceOption MGLTileSourceOptionDEMEncodingSwift
static let demEncoding: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileSize
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster tile source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Raster Tiles API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterTileSourceobjects; it is ignored when initializingMGLVectorTileSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption - 
                            
MGLShapeSourceOptionClustered
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This option corresponds to the
clustersource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Related examples
See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this
MGLShapeSourceOption.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterRadius
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionClusterProperties
An
NSDictionaryobject where the key is anNSString. The dictionary key will be the feature attribute key. The resulting attribute value is aggregated from the clustered points. The dictionary value is anNSArrayconsisting of twoNSExpressionobjects.The first object determines how the attribute values are accumulated from the cluster points. It is an
NSExpressionwith an expression function that accepts two or more arguments, such assumormax. The arguments should befeatureAccumulatedand the previously defined feature attribute key. The resulting value is assigned to the specified attribute key.The second
NSExpressionin the array determines which attribute values are accessed from individual features within a cluster.let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary]This option corresponds to the
clusterPropertiessource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterPropertiesSwift
static let clusterProperties: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevelForClustering
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This option corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.This option only affects point features within an
MGLShapeSourceobject; it is ignored when creating anMGLComputedShapeSourceobject.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMinimumZoomLevel
An
NSNumberobject containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.This option corresponds to the
minzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionMaximumZoomLevel
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This option corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionBuffer
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This option corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionSimplificationTolerance
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This option corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption - 
                            
MGLShapeSourceOptionLineDistanceMetrics
An
NSNumberobject containing a Boolean enabling or disabling calculating line distance metrics.Set this property to
YESin order for theMGLLineStyleLayer.lineGradientproperty to have its intended effect. The default value isNO.This option corresponds to the
lineMetricssource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetricsSwift
static let lineDistanceMetrics: MGLShapeSourceOption - 
                            
MGLTileSourceOptionMinimumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionMaximumZoomLevel
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption - 
                            
MGLTileSourceOptionCoordinateBounds
An
NSValueobject containing anMGLCoordinateBoundsstruct that specifies the geographic extent of the source.If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.
This option corresponds to the
boundskey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBoundsSwift
static let coordinateBounds: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionHTMLString
An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption - 
                            
MGLTileSourceOptionAttributionInfos
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption - 
                            
MGLTileSourceOptionTileCoordinateSystem
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption - 
                            
MGLErrorDomain
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String - 
                            
MGLExpressionInterpolationModeLinear
An
NSStringidentifying thelinearinterpolation type in anNSExpression.This attribute corresponds to the
linearvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinearSwift
static let linear: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeExponential
An
NSStringidentifying theexpotentialinterpolation type in anNSExpression.This attribute corresponds to the
exponentialvalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponentialSwift
static let exponential: MGLExpressionInterpolationMode - 
                            
MGLExpressionInterpolationModeCubicBezier
An
NSStringidentifying thecubic-bezierinterpolation type in anNSExpression.This attribute corresponds to the
cubic-beziervalue in theinterpolateexpression operator in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezierSwift
static let cubicBezier: MGLExpressionInterpolationMode - 
                            
MGLMapViewDecelerationRateNormal
The default deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormalSwift
static let normal: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateFast
A fast deceleration rate for a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFastSwift
static let fast: MGLMapViewDecelerationRate - 
                            
MGLMapViewDecelerationRateImmediate
Disables deceleration in a map view.
Declaration
Objective-C
extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediateSwift
static let immediate: MGLMapViewDecelerationRate - 
                            
MGLMapViewPreferredFramesPerSecondDefault
The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondDefaultSwift
static let `default`: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondLowPower
A conservative frame rate; typically 30 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondLowPowerSwift
static let lowPower: MGLMapViewPreferredFramesPerSecond - 
                            
MGLMapViewPreferredFramesPerSecondMaximum
The maximum supported frame rate; typically 60 FPS.
Declaration
Objective-C
extern const MGLMapViewPreferredFramesPerSecond MGLMapViewPreferredFramesPerSecondMaximumSwift
static let maximum: MGLMapViewPreferredFramesPerSecond - 
                            
MapboxVersionNumber
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double - 
                            
MapboxVersionString
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[]